/**
 * Generate time : 2011-07-16 13:09:12
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZM02
 * 
 */
public class ZM02 extends DaoEPBase {

	private String orgCode = " ";//机构ID
	private String orgName = " ";//机构名称
	private String descInfo = " ";
	private Long sortIndex = new Long(0);
	private String parentName = " ";
	private String attribute = " ";
	private String property = " ";
	private String ext1 = " ";
	private String ext2 = " ";
	private String ext3 = " ";

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("orgCode");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(256);
		eiColumn.setDescName("机构ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("orgName");
		eiColumn.setFieldLength(256);
		eiColumn.setDescName("机构名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("descInfo");
		eiColumn.setFieldLength(256);
		eiColumn.setDescName("备注");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("sortIndex");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("是否是生产单位");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("parentName");
		eiColumn.setFieldLength(256);
		eiColumn.setDescName("上级机构代码");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("attribute");
		eiColumn.setFieldLength(256);
		eiColumn.setDescName("传真");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("property");
		eiColumn.setFieldLength(256);
		eiColumn.setDescName("联系电话");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("ext1");
		eiColumn.setFieldLength(256);
		eiColumn.setDescName("邮编");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("ext2");
		eiColumn.setFieldLength(256);
		eiColumn.setDescName("地址");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("ext3");
		eiColumn.setFieldLength(256);
		eiColumn.setDescName("机构代码");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZM02() {
		initMetaData();
	}

	/**
	 * get the name
	 * 
	 * @return the name
	 */
	public String getOrgCode() {
		return this.orgCode;
	}

	/**
	 * set the name
	 */
	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	/**
	 * get the displayName
	 * 
	 * @return the displayName
	 */
	public String getOrgName() {
		return this.orgName;
	}

	/**
	 * set the displayName
	 */
	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	/**
	 * get the descInfo
	 * 
	 * @return the descInfo
	 */
	public String getDescInfo() {
		return this.descInfo;
	}

	/**
	 * set the descInfo
	 */
	public void setDescInfo(String descInfo) {
		this.descInfo = descInfo;
	}

	/**
	 * get the sortIndex
	 * 
	 * @return the sortIndex
	 */
	public Long getSortIndex() {
		return this.sortIndex;
	}

	/**
	 * set the sortIndex
	 */
	public void setSortIndex(Long sortIndex) {
		this.sortIndex = sortIndex;
	}

	/**
	 * get the parentName
	 * 
	 * @return the parentName
	 */
	public String getParentName() {
		return this.parentName;
	}

	/**
	 * set the parentName
	 */
	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	/**
	 * get the attribute
	 * 
	 * @return the attribute
	 */
	public String getAttribute() {
		return this.attribute;
	}

	/**
	 * set the attribute
	 */
	public void setAttribute(String attribute) {
		this.attribute = attribute;
	}

	/**
	 * get the property
	 * 
	 * @return the property
	 */
	public String getProperty() {
		return this.property;
	}

	/**
	 * set the property
	 */
	public void setProperty(String property) {
		this.property = property;
	}

	/**
	 * get the ext1
	 * 
	 * @return the ext1
	 */
	public String getExt1() {
		return this.ext1;
	}

	/**
	 * set the ext1
	 */
	public void setExt1(String ext1) {
		this.ext1 = ext1;
	}

	/**
	 * get the ext2
	 * 
	 * @return the ext2
	 */
	public String getExt2() {
		return this.ext2;
	}

	/**
	 * set the ext2
	 */
	public void setExt2(String ext2) {
		this.ext2 = ext2;
	}

	/**
	 * get the ext3
	 * 
	 * @return the ext3
	 */
	public String getExt3() {
		return this.ext3;
	}

	/**
	 * set the ext3
	 */
	public void setExt3(String ext3) {
		this.ext3 = ext3;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setOrgCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("orgCode")), orgCode));
		setOrgName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("orgName")), orgName));
		setDescInfo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("descInfo")), descInfo));
		setSortIndex(NumberUtils.toLong(StringUtils.toString(map.get("sortIndex")), sortIndex));
		setParentName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("parentName")), parentName));
		setAttribute(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("attribute")), attribute));
		setProperty(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("property")), property));
		setExt1(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("ext1")), ext1));
		setExt2(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("ext2")), ext2));
		setExt3(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("ext3")), ext3));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("orgCode", StringUtils.toString(orgCode, eiMetadata.getMeta("orgCode")));
		map.put("orgName", StringUtils.toString(orgName, eiMetadata.getMeta("orgName")));
		map.put("descInfo", StringUtils.toString(descInfo, eiMetadata.getMeta("descInfo")));
		map.put("sortIndex", StringUtils.toString(sortIndex, eiMetadata.getMeta("sortIndex")));
		map.put("parentName", StringUtils.toString(parentName, eiMetadata.getMeta("parentName")));
		map.put("attribute", StringUtils.toString(attribute, eiMetadata.getMeta("attribute")));
		map.put("property", StringUtils.toString(property, eiMetadata.getMeta("property")));
		map.put("ext1", StringUtils.toString(ext1, eiMetadata.getMeta("ext1")));
		map.put("ext2", StringUtils.toString(ext2, eiMetadata.getMeta("ext2")));
		map.put("ext3", StringUtils.toString(ext3, eiMetadata.getMeta("ext3")));

		return map;

	}
}